package cn.kgc.entity;


import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * @author YC
 */
@Getter
@Setter
public class CustomerUser extends User {

    /**
     * 项目中的用户实体类
     */
    private Users users;

    public CustomerUser(Users users, Collection<? extends GrantedAuthority> authorities) {
        // 前缀"bcrypt"表示指定密码加密方式为bcrypt
        super(users.getUserName(), "{bcrypt}" + users.getUserPwd(), authorities);
        this.users = users;
    }

}
